<template>
  <div class="repo_list">
    <ul class="repo_info_list">
      <li
        class="repo_info_item"
        @click="$router.push({name:'EventDetails', query:{id:item.id}})"
        v-for="item in pectionList"
        :key="item.id"
      >
        <div class="status">
          <span>事件编号: {{item.inspection_sn}}</span>
          <span>{{item.speed_id == 4? '已完成': '待处理'}}</span>
          <!-- {{item}} -->
        </div>
        <div class="info_fr">
          <img class="info_fr_img" :src="item.inspection_img.split('|')[0]" alt />
        </div>
        <div class="info_fl">
          <h2>{{item.mountain.mountain_name}}</h2>
          <p v-html="item.inspection_des">{{item.inspection_des}}</p>
          <div>
            <span></span>
            <span>{{item.create_time}}</span>
          </div>
        </div>
      </li>
      <li v-show="noMoreData" class="noMoreData">没有更多数据了</li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "RepoList",
  props: {
    pectionList: {
      type: Array,
      default: [],
    },
    noMoreData: {
      type: Boolean,
      default: false,
    },
  },
  data () {
    return {
    };
  }
};
</script>

<style lang="less" scoped>
.repo_list {
  padding: 0 10px;
  .repo_info_list {
    .repo_info_item {
      display: flex;
      flex-wrap: wrap;
      padding: 18px 0;
      border-bottom: 1px solid #eeeeee;
      .status {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        width: 100%;
        font-size: 15px;
        & span:last-child {
          width: 75px;
          height: 31px;
          color: #fff;
          line-height: 31px;
          text-align: center;
          background: #28c08d;
          border-radius: 8px;
        }
      }
      .info_fr {
        width: 110px;
        .info_fr_img {
          width: 100%;
          height: 100px;
          border-radius: 8px;
        }
      }
      .info_fl {
        padding: 10px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        h2 {
          margin-bottom: 10px;
          color: #333;
          font-weight: 700;
          font-size: 16px;
          span {
            color: #28c08d;
            float: right;
          }
        }
        p {
          height: 38px;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 2;
          overflow: hidden;
          color: #999;
        }
        div {
          display: flex;
          justify-content: space-between;
          color: #666;
        }
      }
    }
    .noMoreData {
      text-align: center;
      height: 36px;
      line-height: 36px;
      font-size: 16px;
    }
  }
}
</style>